package com.yungu.swift.system.sys.dao;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yungu.swift.base.mapper.IMapper;
import com.yungu.swift.system.sys.model.dto.SysBusinessDto;
import com.yungu.swift.system.sys.model.dto.SysBusinessOrganizationDto;
import com.yungu.swift.system.sys.model.dto.SysCityDto;
import com.yungu.swift.system.sys.model.vo.BusinessDetailVo;
import com.yungu.swift.system.sys.model.vo.BusinessVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * SystemBusinessOrganizationMapper数据库操作接口类
 **/

public interface SysBusinessOrganizationMapper extends IMapper<SysBusinessOrganizationDto> {

    /**
     * getBusinessDetail
     *
     * @param params Map
     * @return List<BusinessDetailVo>
     */
    List<BusinessDetailVo> getBusinessDetail(Map<String, Object> params);

    /**
     * getCompanyBussinessCountByAgent
     *
     * @param params Map
     * @return int
     */
    int getCompanyBussinessCountByAgent(Map<String, Object> params);

    /**
     * getCityResIds
     *
     * @param params Map
     * @return List<String>
     */
    List<String> getCityResIds(Map<String, Object> params);

    /**
     * batchDelCityResource
     *
     * @param params Map
     * @return int
     */
    int batchDelCityResource(Map<String, Object> params);

    /**
     * getBusiness
     *
     * @param params Map
     * @return List<BusinessVo>
     */
    List<BusinessVo> getBusiness(Map<String, Object> params);

    /**
     * getCityBusiness
     *
     * @param params Map
     * @return List<SysBusinessDto>
     */
    List<SysBusinessDto> getCityBusiness(Map<String, Object> params);


    /**
     * 根据司机uuid 和 业务类型获取抽成列表
     *
     * @param driverUuid
     * @param businessType
     * @return
     */
    List<SysBusinessOrganizationDto> getCommission(@Param("driverUuid") String driverUuid, @Param("businessType") Integer businessType);

    /**
     * queryPageAdmin
     *
     * @param paramMap   Map
     * @param pageBounds PageBounds
     * @return PageList<BusinessVo>
     */
    PageList<BusinessVo> queryPageAdmin(Map<String, Object> paramMap, PageBounds pageBounds);

    /**
     * 查询组织机构已开通的业务
     *
     * @param params Map
     * @return List<SysBusinessDto>
     */
    List<SysBusinessDto> getAllBusinessWithOrganization(Map<String, Object> params);

    /**
     * 查询组织机构已开通的业务城市
     *
     * @param params Map
     * @return List<SysCityDto>
     */
    List<SysCityDto> getAllCityWithOrganizationBusiness(Map<String, Object> params);


    int countBusinessOrganization(Map<String, Object> paras);

    /**
     * 根据司机uuid 和 业务类型获取平台抽成列表
     *
     * @param driverUuid
     * @param businessType
     * @return
     */
    SysBusinessOrganizationDto getPlatformCommission(@Param("driverUuid") String driverUuid, @Param("businessType") Integer businessType);

    /**
     * 根据司机uuid 和 业务类型获取代理抽成列表
     *
     * @param driverUuid
     * @param businessType
     * @return
     */
    SysBusinessOrganizationDto getAgencyCommission(@Param("driverUuid") String driverUuid, @Param("businessType") Integer businessType);

    /**
     * 根据司机uuid 和 业务类型获取公司抽成列表
     *
     * @param driverUuid
     * @param businessType
     * @return
     */
    SysBusinessOrganizationDto getCompanyCommission(@Param("driverUuid") String driverUuid, @Param("businessType") Integer businessType);

}
